package com.pengtu.gsj.dao.lzgl;

import java.util.List;

import org.springframework.stereotype.Repository;

import com.pengtu.gsj.dao.hibernate.HibernateDao;
import com.pengtu.gsj.entity.lzgl.RoadSupInNote;

/**
 * 
 * RoadSupInNoteDao
 * 
 * 2017年9月7日 下午7:08:21
 * 
 * @version 1.0.0
 * 
 */
@Repository
public class RoadSupInNoteDao  extends HibernateDao<RoadSupInNote, String> {

	public List<RoadSupInNote> findRoadSupInNotesByYear(String startTime, String endTime) {
		String hql = "select new com.pengtu.gsj.entity.lzgl.RoadSupInNote("
				+ " t.signOrg,"
				+ " t.year,"
				+ " Round(sum(t.proCheck) / 52, 0),"
				+ " Round(sum(t.proCheck) / 52, 0))"
				+ " from RoadSupInNote t "
				+ " where t.signOrg = ? and t.year >= ? and t.year <= ? and t.delFlag = ?"
				+ " group by t.signOrg, t.year"
				+ " order by t.year ASC";
		return find(hql, "深圳", startTime, endTime, "0");
	}
}
